title Hexa to Decimally
;
; This program will transform a 4 digit number in hexa to decimally
dosseg
.model small,c
.386
.stack 100h

.data 

  
.code

start:
	mov ax,@data
	mov ds,ax       ; Direct DS to data segment.
        mov eax,6345083;
	mov cx,0;
	
        
	
	nextdigit:	cmp eax,0;
			je write;
			mov dx,0;
			mov ebx,8;
			div ebx;
			push dx;
			inc cx;	
			jmp nextdigit;
	
	write:	pop ax;
		add al,30h;
		mov ah,14;
		mov bx,0;
		int 10h;
		loop write;
							
			

	; Return to Dos.
exit:   mov ax,4c00h
	int 21h

	end start


